<template>
  <ul>
    <li v-for="(list,index) in lists" :key="index"></li>
  </ul>
</template>

<script>
import axios from 'axios'
export default {
  data () {
    lists: []
  },
  // async 写法
  // async mounted () {
  //   let { data } = await axios.get('/list');
  //   this.lists = data;
  // }

  // 不是 async写法
  mounted () {
    axios.get('/list').then(res => {
      this.lists = res.data;
    })
  }
}
</script>

<style>
</style>